<?php

namespace System\Controller;

use Zend\Mvc\Controller\AbstractActionController;
use Zend\Session\Container;

class IndexController extends AbstractActionController {

    private function checkLogin() {
        $session = new Container("ssadmin");
        if ($session->adminusername == null) {
            $this->redirect()->toUrl(WEB_PATH . "/cpadmin");
        }
    }

    public function indexAction() {
        $this->checkLogin();
        $this->layout("layout/layoutadmin");
    }

    public function changepassAction() {
        $this->checkLogin();
        $this->layout("layout/layoutadmin");
    }

}
